package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.CourseComment;
import com.ruoyi.business.domain.bo.CourseCommentBo;
import com.ruoyi.business.mapper.CourseCommentMapper;
import com.ruoyi.business.service.ICourseCommentService;
import com.ruoyi.common.utils.bean.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 最爱喝兽奶
 * @create 2022/8/1
 **/
@SuppressWarnings("ALL")
@Service
public class CourseCommentServiceImpl extends ServiceImpl<CourseCommentMapper, CourseComment> implements ICourseCommentService {

    @Autowired
    private CourseCommentMapper courseCommentMapper;

    @Override
    public void insertCourseComment(CourseCommentBo bo) {
        CourseComment courseComment = new CourseComment();
        BeanUtils.copyBeanProp(courseComment, bo, true);
        // 查询上一条course的排序
        // TODO: 排序暂定
        courseCommentMapper.insert(courseComment);
    }


}
